package com.sj.proxy;

import java.lang.reflect.Method;

public class Tank4 implements IMoveable {
    private Tank t;
    private InvocationHandler handler;

    public Tank4(Tank t, InvocationHandler handler) {
        this.t = t;
        this.handler = handler;
    }

    public void move() {
        try {
            Method md = IMoveable.class.getMethod("move");
            handler.invoke(t, md);
//            handler.invoke(this, md);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
